<clr-modal [(clrModalOpen)]="createNamespaceUserOpened" [clrModalSize]="'lg'">
  <h3 class="modal-title">{{namespaceUserTitle}}</h3>
  <div class="modal-body">
    <form #namespaceUserForm="ngForm">
      <section class="form-block">
        <!-- <div class="form-group" style="padding-left: 135px;"> -->
        <!--   <label for="namespace_user_id" class="col-md-3 form-group-label-override required">用户</label> -->
        <!--   <div class="select form-control"> -->
        <!--     <select id="namespace_user_id" [(ngModel)]="namespaceUser.user.id" [disabled]="actionType==1" name="namespace_user_id"> -->
        <!--       <option *ngFor="let user of users" [ngValue]="user.id" [selected]="user.id == namespaceUser.user.id"> -->
        <!--         {{user.name}} -->
        <!--       </option> -->
        <!--     </select> -->
        <!--   </div> -->
        <!-- </div> -->
        <div class="form-group" style="padding-left: 135px;">
          <label for="name" class="col-md-3 form-group-label-override required">名称</label>
          <label for="name" aria-haspopup="true" role="tooltip" [class.invalid]="!isNameValid" class="tooltip tooltip-validation tooltip-md tooltip-bottom-left form-control">
            <input class="form-control" type="text" id="namespace_user_name"  [(ngModel)]="namespaceUser.user.name"
                   name="name" size="32"
                   required
                   [readonly]="actionType==1"
                   maxlength="32"
                   (keyup)='handleValidation()'>
            <span class="tooltip-content">
              用户不存在
            </span>
          </label>
          <span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span>
        </div>
        <div class="form-group" style="padding-left: 135px;height:250px;">
          <label for="namespace_user_group" class="col-md-3 form-group-label-override required">群组</label>
          <label for="namespace_user_group" aria-haspopup="true" role="tooltip" [class.invalid]="!isNameValid"
                 class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
            <ng2-dual-list-box name="namespace_user_group"
                               [data]="allGroups"
                               valueField="id"
                               textField="name"
                               availableText="可选项"
                               selectedText="已选项"
                               [(ngModel)]="selectGroups"
            >
            </ng2-dual-list-box>
          </label>
        </div>

      </section>
    </form>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-outline" (click)="onCancel()">取消</button>
    <button type="button" class="btn btn-primary" [disabled]="!isValid" (click)="onSubmit()">提交</button>
  </div>
</clr-modal>
